# Maintainer: Felix Yan <felixonmars@archlinux.org>
# Contributor: robertfoster

pkgname=libpam-google-authenticator
pkgver=1.09
pkgrel=1
pkgdesc='PAM module for google authenticator app'
arch=('loong64' 'x86_64')
url="https://github.com/google/google-authenticator-libpam"
license=('Apache')
depends=('pam')
optdepends=('qrencode: scannable QR codes for google auth phone app')
source=("$pkgname-$pkgver.tar.gz::https://github.com/google/google-authenticator-libpam/archive/$pkgver.tar.gz")
sha512sums=('c71cec3200214f7a6c7f7f33fdc0f00e812b378940be92017785bbba82236b90d443977a2af12465285316e3dade0313f4d6df1f3d85f37f830d9877c7c33754')

build() {
  cd google-authenticator-libpam-$pkgver
  ./bootstrap.sh
  ./configure --prefix=/usr
  make
}

package() {
  cd google-authenticator-libpam-$pkgver
  make DESTDIR="$pkgdir" install
  libtool --finish "$pkgdir"/usr/lib/security
}
